]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Don't use get_core_device
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 27 Feb 2014 19:01:30 +0000 (14:01 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 27 Feb 2014 19:55:29 +0000 (14:55 -0500)
clutter_device_manager_get_core_device calls XIGetClientPointer, which
requires a round-trip to the server. Since we do this on StWidget
creation, this means a full round-trip for every created StWidget.
Replace this with get_device with the ID of the VCP/VCK, since mutter
doesn't support MPX, and we know this is what the device is.

src/shell-global.c
src/shell-screenshot.c
src/st/st-widget.c

index 59b5273d19be11290acd6c1c3aae03c2d8fb9df1..d44d5520a0bd2cb4ed33418c595c98b478664351 100644 (file)
@@ -819,8 +819,8 @@ gnome_shell_gdk_event_handler (GdkEvent *event_gdk,
       if (event_gdk->key.window == global->ibus_window)
         {
           ClutterDeviceManager *device_manager = clutter_device_manager_get_default ();
-          ClutterInputDevice *keyboard = clutter_device_manager_get_core_device (device_manager,
-                                                                                 CLUTTER_KEYBOARD_DEVICE);
+          ClutterInputDevice *keyboard = clutter_device_manager_get_device (device_manager,
+                                                                            META_VIRTUAL_CORE_KEYBOARD_ID);
 
           ClutterEvent *event_clutter = clutter_event_new ((event_gdk->type == GDK_KEY_PRESS) ?
                                                            CLUTTER_KEY_PRESS : CLUTTER_KEY_RELEASE);
@@ -1280,8 +1280,8 @@ shell_global_sync_pointer (ShellGlobal *global)
   event.y = y;
   event.modifier_state = mods;
   event.axes = NULL;
-  event.device = clutter_device_manager_get_core_device (clutter_device_manager_get_default (),
-                                                         CLUTTER_POINTER_DEVICE);
+  event.device = clutter_device_manager_get_device (clutter_device_manager_get_default (),
+                                                    META_VIRTUAL_CORE_POINTER_ID);
 
   /* Leaving event.source NULL will force clutter to look it up, which
    * will generate enter/leave events as a side effect, if they are
index 991a55450caa4476edb3f5d5f7f81d224a8321f2..a076aaabc3164eb3f8cb52aa38f9e25ef9470481 100644 (file)
@@ -253,7 +253,7 @@ get_pointer_coords (int *x,
   ClutterPoint point;
 
   manager = clutter_device_manager_get_default ();
-  device = clutter_device_manager_get_core_device (manager, CLUTTER_POINTER_DEVICE);
+  device = clutter_device_manager_get_device (manager, META_VIRTUAL_CORE_POINTER_ID);
 
   clutter_input_device_get_coords (device, NULL, &point);
   *x = point.x;
index 6aa3258d3c5d7e8a49ecbc448556b3c59f188296..ef0e9528ce076a8ec803b924d306b38a40538e27 100644 (file)
@@ -46,6 +46,9 @@
 #include <gtk/gtk.h>
 #include <atk/atk-enum-types.h>
 
+/* This is set in stone and also hard-coded in GDK. */
+#define VIRTUAL_CORE_POINTER_ID 2
+
 /*
  * Forward declaration for sake of StWidgetChild
  */
@@ -1722,8 +1725,7 @@ st_widget_sync_hover (StWidget *widget)
   ClutterActor *pointer_actor;
 
   device_manager = clutter_device_manager_get_default ();
-  pointer = clutter_device_manager_get_core_device (device_manager,
-                                                    CLUTTER_POINTER_DEVICE);
+  pointer = clutter_device_manager_get_device (device_manager, VIRTUAL_CORE_POINTER_ID);
   pointer_actor = clutter_input_device_get_pointer_actor (pointer);
   if (pointer_actor)
     st_widget_set_hover (widget, clutter_actor_contains (CLUTTER_ACTOR (widget), pointer_actor));